<template>
	<view class="content">
		<!-- 空白页 -->
		<view class="zwtimg placeholderimg flexcenter" style="margin-top: 300rpx;" v-if="recordList.data.length==0">
			<image src="@/static/image/bg-icons/placeholderimg.png" mode=""></image>
		</view>
		<view class="padding_lrb ffffff margin_top" v-else>
			<view class="flexbetween line" v-for="item in recordList.data" :key="item.id">
				<view class="margin_top">
					<view class="reds">{{item.price}}</view>
					<view class="time padding_bottom">{{item.createtime_text}}</view>
				</view>
				<view class="wancheng" v-if="item.status==0">待审核</view>
				<view class="wancheng" v-if="item.status==1">已完成</view>
				<view class="wancheng" v-if="item.status==2">已拒绝</view>
				<!-- <view class="text_b color_jiu">已拒绝</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				recordList: {
					data: []
				}
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this
				httpRequest.request('/api/user/getWithdrawalList', 'GET', {
					page: page || 1,
					limit: _this.limit
				}).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.recordList;
						if (isPage == true) {
							_this.recordList.data = dataList.data.concat(resList.data);
						} else {
							_this.recordList = res.data
							_this.recordList.data = resList.data;
						}
					} else if (res.code == 0) {
						httpRequest.toast(res.msg);
					} else {
						httpRequest.toast('网络开小差啦');
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.recordList;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style>
	.content {
		overflow: hidden;

	}

	.wancheng {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
	}

	.reds {
		font-size: 32rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: rgba(212, 139, 57, 1);
	}

	.time {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
		margin-top: 11rpx;
	}
</style>